<%@page import="com.shsh.safemanage.model.Department3"%>
<%@page import="com.shsh.safemanage.model.Department2"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.model.Department1"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.TitlePostManageGroupDao"%>
<%@page import="com.shsh.safemanage.model.JobPost"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<%
{
Long theDepart1ID = 0L;
Long theDepart2ID = 0L;
Long theJobPostID = 0L;

String depart1IDStr = request.getParameter(Constants.REQUEST_PARAMETER_DEPARTMENT1ID);
String depart2IDStr = request.getParameter(Constants.REQUEST_PARAMETER_DEPARTMENT2ID);
try {
	theDepart1ID = new Long(depart1IDStr);
	theDepart2ID = new Long(depart2IDStr);
} catch (Exception e) {
}

String theJobPostIDStr = (String)request.getParameter(Constants.REQUEST_PARAMETER_JOB_POST_ID);
try{
	theJobPostID = Long.parseLong(theJobPostIDStr);
}catch(Exception e){
	
}

TitlePostManageGroupDao postDao = DaoCreator.createTitlePostManageGroupDao();
List<JobPost> jobPostList = postDao.getJobPostByDepart1IDandDepart2ID(theDepart1ID, theDepart2ID);
%>
<select id="jobpost" onchange="selectJobpost();">
<%
for (JobPost jobPost: jobPostList) {
%>
	<option value="<%=jobPost.getId()%>" <%=theJobPostID.equals(jobPost.getId())? "selected":""%> ><%=jobPost.getPostName()%></option>
<%
}
%>
</select>
<%
}
%>
